package co.edu.usbcali.raju.games.chess.helpers;

import jpl.Term;
import co.edu.usbcali.raju.games.PieceWrapper;
import co.edu.usbcali.raju.games.chess.model.ChessPiece;
import co.edu.usbcali.raju.model.Piece;

public class PlPieceWrapper implements PieceWrapper{
	public static final int ARG_PIECE=1;
	public static final int ARG_PLAYER=2;

	
	private static PlPieceWrapper instance;
	
	public static PlPieceWrapper getInstance(){
		if (instance==null){
			instance=new PlPieceWrapper();
		}
		return instance;
	}

	@Override
	public Object exportPiece(Piece board) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Piece importPiece(Object object) {
		Term term=(Term)object;
		ChessPiece chessPiece=new ChessPiece(term.arg(ARG_PIECE).toString(),term.arg(ARG_PLAYER).toString());
		return chessPiece;
	}

}
